import datetime

from sqlalchemy import Column, DateTime, Integer, SmallInteger, String, Text

from common.db import Base


class Role(Base):
    __tablename__ = "role"
    
    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(String(32), unique=True, nullable=False)
    routers = Column(Text)
    create_time = Column(DateTime, default=datetime.datetime.now)
    # onupdate=True自动更新时间
    update_time = Column(DateTime, default=datetime.datetime.now, onupdate=True)
    # 1删，0不删除
    is_delete = Column(SmallInteger, server_default=0)



